<script language="javascript" type="text/javascript">   
Joomla.submitbutton = function(pressbutton) {
	if (pressbutton == 'cancel') {		
		submitform( pressbutton );	
		return;	
	}

	$('error_area').setStyle('display', 'none');
	if (pressbutton == 'save') {
		var form = document.adminForm;
				
		if (form.code.value == '') {
			$('error_area').setStyle('display', 'block');         
			$('msg').set('text', 'Please input code');
			$('code').addClass('invalid');
			return false;    
		} else {
			$('code').removeClass('invalid');
		}

		if (form.name.value == '') {
			$('error_area').setStyle('display', 'block');         
			$('msg').set('text', 'Please input name');
			$('name').addClass('invalid');
			return false;    
		} else {
			$('name').removeClass('invalid');
		}
		
		submitform(pressbutton);			
	}	
};   
</script>

<div id="error_area" style="display:none">
<dl id="system-message">
<dd class="error message">
	<ul><li id="msg"></li></ul>
</dd>
</dl>
</div>

<form action="index.php?option=com_manager" method="post" name="adminForm" enctype="multipart/form-data">	
	<table class="adminform" width="100%">		
	    <tr>
	        <td width="10%" >
	            <label for="Code">
	                <?php echo JText::_( 'Code' ); ?><span class="star">&nbsp;*</span>
	            </label>
	        </td>
	        <td width="40%">
	        	<input type="text" name="code" id="code" class="required" value="<?php echo $this->rows->code ; ?>" />
	        </td>   			
 			<td width="10%" >
	            <label for="Name">
	                <?php echo JText::_( 'Name' ); ?><span class="star">&nbsp;*</span>
	            </label>
	        </td>
	        <td width="40%">
	        	<input type="text" name="name" id="name" class="required" value="<?php echo $this->rows->name ; ?>" />
	        </td> 
	    </tr>

		<tr>
	        <td width="10%" >
	            <label for="scientific_name">
	                <?php echo JText::_( 'Scientific Name' ); ?>
	            </label>
	        </td>
	        <td width="40%">
	        	<input type="text" name="scientific_name" id="scientific_name" value="<?php echo $this->rows->scientific_name ; ?>" />
	        </td> 	        
	        <td width="10%" >
	            <label for="link">
	                <?php echo JText::_( 'Link' ); ?>
	            </label>
	        </td>
	        <td width="40%">
	        	<input type="text" name="link" id="link" value="<?php echo $this->rows->link ; ?>" />
	        </td>  
	    </tr>
	    	    	    
	    <tr>
	        <td width="10%" >
	            <label for="image">
	                <?php echo JText::_( 'Image' ); ?>
	            </label>
	        </td>
	        <td width="40%">
	        	<input type="file" name="image" id="image" />
	        </td>  	        	          	        
	    </tr>
	    
	    <tr>
	    	<td width="10%">
	    		<label for="content">
	                <?php echo JText::_( 'Content' ); ?>
	            </label>
	    	</td>
	    	<td colspan="3">
			    <?php
					$editor =& JFactory::getEditor();
					echo $editor->display('content', $this->rows->content, '100%', '400', '60', '20', false);
				?>
			</td>
	    </tr>	    
   </table>
   
	<input type="hidden" name="option" value="com_manager" />
	<input type="hidden" id="id" name="id" value="<?php echo $this->rows->id; ?>" />
	<input type="hidden" id="c" name="c" value="fishclass" />
	<input type="hidden" name="task" value="save" />
</form>